#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include<QTextEdit>
#include<QLabel>



QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow;class DemoWidget; }
QT_END_NAMESPACE



struct TextStatus{
    bool newFileContent;
    bool openFileChanged;
    bool hasFileContent;
    bool opened;
    bool newed;
    bool saved;
    QString currentFilename;
    QString currentFilePath;
    QString coding;


    TextStatus();
};



class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void reopenWithCoding(const char *coding);



private slots:
    void on_actionnew_triggered();

    void on_actionfont_triggered();

    void on_actionsave_triggered();

    void on_actionopen_triggered();

    void on_actionclose_triggered();

    void on_actionconvert_triggered();

    void on_actionGB2312_triggered();

    void on_actionUTF_8_triggered();

    void on_actionGBK_triggered();

    void on_actionASCII_triggered();

    void on_actionUTF_16_triggered();

    void on_actionUTF_32_triggered();

    void on_actionLatin_1_triggered();

private:
    Ui::MainWindow *ui;

    QTextEdit *te;
    QLabel *nameLabel;
    TextStatus ts;
    QLabel *codeLabel;
};


#endif // MAINWINDOW_H
